﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;

namespace MDIDemo.Windows
{
    public partial class frmViewQuyDoiDonVi : DevExpress.XtraEditors.XtraForm
    {
        Double _value = 0;

        public Double Value
        {
            get { return _value; }
            set { _value = value; }
        }
        public frmViewQuyDoiDonVi()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Value = Convert.ToDouble(txtKetQua.EditValue);
            //txtKetQua.EditValue = Convert.ToDouble(txtTrongLuong.EditValue) / Convert.ToDouble(txtDoDay.EditValue) / Convert.ToDouble(txtDoRong.EditValue) / 7.85 * 1000;
            //Value = (Double)txtKetQua.EditValue;
            DialogResult = DialogResult.OK;
            Close();

        }


        private void txtTrongLuong_Validated_1(object sender, EventArgs e)
        {
            txtKetQua.EditValue = Convert.ToDouble(txtTrongLuong.Value) / Convert.ToDouble(txtDoDay.Value) / Convert.ToDouble(txtDoRong.Value) / 7.85 * 1000;
        }
    }
}